import request from 'umi-request';

export async function queryBankCardList(params,index) {
  return request('/hr-ssc/api/api-admin/salary/getUserBankCardPage', {
    method: 'get',
    params: {
      ...params,
      pageNum: params.current,
      status: index === '1' ? parseInt(index) : null,
    },
  }).then((res) => {
    if (res.flag) {
      const data = res.data;
      return {
        current: data.currPage,
        data: data.list,
        pageSize: data.pageSize,
        success: true,
        total: data.totalCount,
      };
    } else {
      return {};
    }
  });
}

export async function updateBankCardStatus(id,status,remark) {
  return request(`/hr-ssc/api/api-admin/salary/updateUserBankCardStatus`, {
    method: 'get',
    params:{
      id:id,
      status:status,
      remark: remark
    }
  }).then((res) => {
    return res;
  });
}
